URL
https://opencores.org/ocsvn/8051/8051/trunk
[/] [8051/] [trunk/] [asm/] [lcall.asm] - Diff between revs 131 and 155
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 131 |
Rev 155 |
Line 41... |
Line 41... |
; test relative jumps
|
; test relative jumps
|
;
|
;
|
|
|
|
|
org 01f0h ;
|
org 01f0h ;
|
done:
|
test_r1:
|
nop ;
|
nop ;
|
mov p0, #33h ;
|
mov p0, #33h ;
|
ajmp done ;
|
ajmp test_r2 ;
|
|
|
org 0210h
|
org 0210h
|
test:
|
test:
|
mov b, #04h ;
|
mov b, #04h ;
|
clr a ;
|
clr a ;
|
jz done ;
|
jz test_r1 ;
|
|
|
org 02f0h ;
|
org 02f0h ;
|
mov r0, #00 ;
|
mov r0, #00 ;
|
ljmp error ;
|
ljmp error ;
|
|
|
|
test_r2:
|
|
mov b, #05h ;
|
|
mov r4, #10h ;
|
|
mov r5, #20h ;
|
|
mov a, r4 ;
|
|
subb a, #10h ;
|
|
jnz error1 ;
|
|
mov a, r5 ;
|
|
subb a, #20h ;
|
|
jnz error1 ;
|
|
|
|
mov b, #06h ;
|
|
mov r4, b ;
|
|
mov a, r5 ;
|
|
subb a, #20h ;
|
|
jnz error1 ;
|
|
mov a, r4 ;
|
|
subb a, #06h ;
|
|
jnz error1 ;
|
|
mov b, #06h ;
|
|
|
|
mov r0, #02h ;
|
|
mov a, #044h ;
|
|
mov b, #044h ;
|
|
subb a, b ;
|
|
jnz error1 ;
|
|
|
|
mov r0, #03h ;
|
|
mov a, #04h ;
|
|
mov b, #084h ;
|
|
clr b.7 ;
|
|
subb a, b ;
|
|
jnz error1 ;
|
|
|
|
mov r0, #03h ;
|
|
mov a, #04h ;
|
|
mov b, #084h ;
|
|
clr b.7 ;
|
|
subb a, b ;
|
|
jnz error1 ;
|
|
|
|
mov r0, #04h ;
|
|
mov psw, #00h ;
|
|
setb c ;
|
|
mov a, #0e4h ;
|
|
subb a, #04h ;
|
|
mov a, psw ;
|
|
subb a, #041h ;
|
|
jnz error1 ;
|
|
ajmp test_lcall ;
|
|
|
|
error1:
|
|
ljmp error ;
|
|
;;;;;;;;;;;;;;;;;;
|
|
|
|
test_lcall:
|
|
mov r0, #05h ;
|
|
clr a ;
|
|
lcall tst1 ;
|
|
inc a ;
|
|
subb a, #3h ;
|
|
jnz error1 ;
|
|
ljmp done ;
|
|
inc a ;
|
|
inc a ;
|
|
tst1:
|
|
lcall tst2 ;
|
|
inc a ;
|
|
ret ;
|
|
inc a ;
|
|
inc a ;
|
|
|
|
tst2:
|
|
inc a ;
|
|
ret ;
|
|
inc a ;
|
|
inc a ;
|
|
|
|
;;;;;;;;;;;;;;;;;;
|
|
|
|
done:
|
|
nop ;
|
|
mov p0, #34h ;
|
|
ajmp done ;
|
|
|
|
|
end
|
end
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.