changed (and fixed) msb(long) and lsb(long)

This commit is contained in:
Irmen de Jong
2025-10-13 21:34:03 +02:00
parent 6286035d89
commit 68066acdec
13 changed files with 170 additions and 78 deletions

View File

@@ -6,14 +6,25 @@ main {
sub start() {
long @shared lv1 = $12345678
; TODO support long+1 / -1 expressions....
cx16.r4 = msw(lv1-1)
cx16.r5 = lsw(lv1-1)
txt.print_uwhex(cx16.r4, true)
txt.print_uwhex(cx16.r5, true)
txt.print_ubhex(msb(lv1), true)
txt.spc()
txt.print_ubhex(lsb(lv1), true)
txt.spc()
txt.print_ubhex(lv1 as ubyte, true)
txt.nl()
txt.print_uwhex(msw(lv1), true)
txt.spc()
txt.print_uwhex(lsw(lv1), true)
txt.nl()
txt.print_ubhex((lv1-1) as ubyte, true)
txt.nl()
; ; TODO support long+1 / -1 expressions....
; cx16.r4 = msw(lv1-1)
; cx16.r5 = lsw(lv1-1)
; txt.print_uwhex(cx16.r4, true)
; txt.print_uwhex(cx16.r5, true)
; txt.nl()
;
; txt.print_ubhex((lv1-1) as ubyte, true)
; txt.nl()
}
}