This repository has been archived by the owner on May 21, 2024. It is now read-only.
forked from boriel-basic/zxbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request boriel-basic#685 from boriel/bugfix/peek_ulong
fix: fixes PEEK(ULong, ...)
- Loading branch information
Showing
8 changed files
with
202 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
org 32768 | ||
.core.__START_PROGRAM: | ||
di | ||
push ix | ||
push iy | ||
exx | ||
push hl | ||
exx | ||
ld hl, 0 | ||
add hl, sp | ||
ld (.core.__CALL_BACK__), hl | ||
ei | ||
jp .core.__MAIN_PROGRAM__ | ||
.core.__CALL_BACK__: | ||
DEFW 0 | ||
.core.ZXBASIC_USER_DATA: | ||
; Defines USER DATA Length in bytes | ||
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA | ||
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN | ||
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA | ||
_x: | ||
DEFB 00, 00 | ||
_y: | ||
DEFB 00 | ||
.core.ZXBASIC_USER_DATA_END: | ||
.core.__MAIN_PROGRAM__: | ||
ld a, (16384) | ||
ld (_y), a | ||
ld hl, (_x) | ||
ld a, (hl) | ||
ld (_y), a | ||
ld hl, (_x) | ||
ld a, (hl) | ||
ld (_y), a | ||
ld hl, 0 | ||
ld b, h | ||
ld c, l | ||
.core.__END_PROGRAM: | ||
di | ||
ld hl, (.core.__CALL_BACK__) | ||
ld sp, hl | ||
exx | ||
pop hl | ||
exx | ||
pop iy | ||
pop ix | ||
ei | ||
ret | ||
;; --- end of user code --- | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DIM x as UInteger | ||
|
||
DIM y as UByte | ||
y = PEEK(UByte, 16384) | ||
y = PEEK(UByte, x) | ||
y = PEEK(UByte, x + 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
org 32768 | ||
.core.__START_PROGRAM: | ||
di | ||
push ix | ||
push iy | ||
exx | ||
push hl | ||
exx | ||
ld hl, 0 | ||
add hl, sp | ||
ld (.core.__CALL_BACK__), hl | ||
ei | ||
jp .core.__MAIN_PROGRAM__ | ||
.core.__CALL_BACK__: | ||
DEFW 0 | ||
.core.ZXBASIC_USER_DATA: | ||
; Defines USER DATA Length in bytes | ||
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA | ||
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN | ||
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA | ||
_x: | ||
DEFB 00, 00 | ||
_y: | ||
DEFB 00, 00 | ||
.core.ZXBASIC_USER_DATA_END: | ||
.core.__MAIN_PROGRAM__: | ||
ld hl, (16384) | ||
ld (_y), hl | ||
ld hl, (_x) | ||
ld a, (hl) | ||
inc hl | ||
ld h, (hl) | ||
ld l, a | ||
ld (_y), hl | ||
ld hl, (_x) | ||
ld a, (hl) | ||
inc hl | ||
ld h, (hl) | ||
ld l, a | ||
ld (_y), hl | ||
ld hl, 0 | ||
ld b, h | ||
ld c, l | ||
.core.__END_PROGRAM: | ||
di | ||
ld hl, (.core.__CALL_BACK__) | ||
ld sp, hl | ||
exx | ||
pop hl | ||
exx | ||
pop iy | ||
pop ix | ||
ei | ||
ret | ||
;; --- end of user code --- | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DIM x as UInteger | ||
|
||
DIM y as UInteger | ||
y = PEEK(UInteger, 16384) | ||
y = PEEK(UInteger, x) | ||
y = PEEK(UInteger, x + 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
org 32768 | ||
.core.__START_PROGRAM: | ||
di | ||
push ix | ||
push iy | ||
exx | ||
push hl | ||
exx | ||
ld hl, 0 | ||
add hl, sp | ||
ld (.core.__CALL_BACK__), hl | ||
ei | ||
jp .core.__MAIN_PROGRAM__ | ||
.core.__CALL_BACK__: | ||
DEFW 0 | ||
.core.ZXBASIC_USER_DATA: | ||
; Defines USER DATA Length in bytes | ||
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA | ||
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN | ||
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA | ||
_x: | ||
DEFB 00, 00 | ||
_y: | ||
DEFB 00, 00, 00, 00 | ||
.core.ZXBASIC_USER_DATA_END: | ||
.core.__MAIN_PROGRAM__: | ||
ld hl, 16384 | ||
call .core.__ILOAD32 | ||
ld (_y), hl | ||
ld (_y + 2), de | ||
ld hl, (_x) | ||
call .core.__ILOAD32 | ||
ld (_y), hl | ||
ld (_y + 2), de | ||
ld hl, (_x) | ||
call .core.__ILOAD32 | ||
ld (_y), hl | ||
ld (_y + 2), de | ||
ld hl, 0 | ||
ld b, h | ||
ld c, l | ||
.core.__END_PROGRAM: | ||
di | ||
ld hl, (.core.__CALL_BACK__) | ||
ld sp, hl | ||
exx | ||
pop hl | ||
exx | ||
pop iy | ||
pop ix | ||
ei | ||
ret | ||
;; --- end of user code --- | ||
#line 1 "/zxbasic/src/arch/zx48k/library-asm/iload32.asm" | ||
; __FASTCALL__ routine which | ||
; loads a 32 bits integer into DE,HL | ||
; stored at position pointed by POINTER HL | ||
; DE,HL <-- (HL) | ||
push namespace core | ||
__ILOAD32: | ||
ld e, (hl) | ||
inc hl | ||
ld d, (hl) | ||
inc hl | ||
ld a, (hl) | ||
inc hl | ||
ld h, (hl) | ||
ld l, a | ||
ex de, hl | ||
ret | ||
pop namespace | ||
#line 29 "peek_ulong.bas" | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DIM x as UInteger | ||
|
||
DIM y as ULong | ||
y = PEEK(ULong, 16384) | ||
y = PEEK(ULong, x) | ||
y = PEEK(ULong, x + 0) |