สำนักงานราชบัณฑิตยสภา
167 ศ. ดร.มงคล เดชนคริ นทร์ วารสารราชบัณฑิตยสถาน ปีที่ ๓๘ ฉบับที่ ๓ ก.ค.-ก.ย. ๒๕๕๖ - 22 - ; Page 9 INC DI LOOP DAT_REC JMP SHORT CH_SM EOF_REC: CALL GET_BYT ;read chksm byte CALL CHK_SUM JMP GET_COM ;get next cmnd EAD_REC: CALL GET_WRD ;get new seg addr in AX, 1 wrd SHL AX,1 SHL AX,1 SHL AX,1 SHL AX,1 MOV BP,AX CH_SM: CALL GET_BYT ;read chksm byte & add to C_SUM CALL CHK_SUM ;correct data gives 0 in C_SUM JMP NXT_REC ;get next rec SAD_REC: CALL GET_WRD ;skip 2 wrds by 2 dummy read CALL GET_WRD JMP CH_SM ; M Command, Move memory data M_OVE: CALL GET_NUM ;get start addr using DX MOV SI,DX ;store it in SI CALL GET_NUM ;get end addr SUB DX,SI ;block length - 1 MOV CX,DX INC CX ;loop cntr = block length CALL GET_NUM ;get destin addr MOV DI,DX ;store it in DI MVIT: MOV AL,BYTE PTR[SI] ;read a byte from source MOV BYTE PTR[DI],AL ;write it to destin INC SI ;advance ptr INC DI LOOP MVIT JMP GET_COM ;get next cmnd ; O Command, Output data to a port ; try <O 29 00> then <O 29 FF> and watch 8255 LEDs P_OUT: CALL GET_NUM ;get port addr in DX w/ echo ; Page 10 PUSH DX ;store it instack CALL BLANK ;send a blank CALL GET_NUM ;get data to be ported MOV AL,DL ;take only lo byte POP DX ;retrieve port addr OUT DX,AL ;output data to port JMP GET_COM ; R Command, Registers display D_REG: CALL DPR ;use aux routine DPR JMP GET_COM ; S Command, Stop processor ; restart CPU by toggling TEST switch S_TOP: CALL BLANK ;send a blank LEA SI,S_MSG ;ptr to message CALL S_END ;send to PC HLT ; T Command, Test a port (not available now!) T_EST: CALL BLANK ;send a blank LEA SI,TST_MSG ;ptr to test msg CALL S_END ;display msg on PC JMP GET_COM ; X Command, eXamine memory, may change data there E_XAM: CALL GET_NUM ;get start addr using DX MOV SI,DX ;save it in SI DO_LYN: CALL CRLF ;begin new line MOV DX,SI ;retrieve start addr CALL C_OUT ;display it on PC CALL BLANK ;followed by 2 blanks CALL BLANK MOV AL,BYTE PTR[SI] ;read mem data CALL HTOA ;display the byte MOV AL,'?' ;ask for substitute CALL C_OUT CALL GET_NUM ;get new data w/ BH as flag CMP BH,'0' ;substitute coming?
Made with FlippingBook
RkJQdWJsaXNoZXIy NTk0NjM=