div.asm
1 ; Test program to verify correct emu8051 operation 2 ; 3 ; Test desc: DIV AB 4 ; Test output: PC = $FFF0 5 ; Test output: SP = $07 6 ; Test output: A = $3C 7 ; Test output: B = $00 8 ; Test output: PSW = $00 9 10 ORG 0000h ; Reset vector 11 12 MOV A, #0FFh 13 MOV B, #00h 14 DIV AB ; CY should be cleared, OV should be set 15 ; PSW = $04 16 17 MOV A, #240 ; 240d 18 MOV B, PSW ; 4d 19 DIV AB ; CY should be cleared, OV should be cleared, result = 10 20 21 LJMP 0FFF0h 22 END