This file contains hidden or 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
| REAL_ORG = #3c51 | |
| DICT_BEGIN = #3c49 | |
| DATA_REG = 129 | |
| CONTROL_REG = 128 | |
| RTS_LOW = #16 | |
| RTS_HIGH = #56 | |
| MACRO CHECKSUM start? | |
| opt push listoff ; disable listing while calculating checksum | |
| .ptr = start? |
This file contains hidden or 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
| OUTPUT "ECHO" | |
| ORG 8192 | |
| Start: ex de,hl | |
| ld a,d | |
| or e | |
| ret z ; DE == 0, no pointer to arguments | |
| Print: ld a,(de) | |
| or a | |
| ret z ; zero byte end of command line | |
| cp 13 |
This file contains hidden or 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
| LimitHlValue: | |
| ; In: HL = value to be clamped to -0x100 .. +0x100 | |
| ; Out: HL = clamped value | |
| ; Uses: A + flags | |
| ; (this is not mathematically correct, values 0x7F?? clamp to -0x100, for performance reasons) | |
| ld a,h | |
| inc a | |
| sra a ; will be 0 for -256..+255 (+256 will get "clamped") | |
| ret z | |
| ld hl,0x100 |
This file contains hidden or 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
| ; syntax for https://github.com/z00m128/sjasmplus/releases assembler | |
| OPT --syntax=abfw --zxnext | |
| ;;---------------------------------------------------------------------------------------- | |
| ;; reads nextreg in A into A | |
| ReadNextReg: | |
| ; Input | |
| ; A = nextreg to read | |
| ; Output: |
This file contains hidden or 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
| DEVICE ZXSPECTRUM48 | |
| OPT reset --zxnext=cspect --syntax=abfw | |
| ORG $8000 | |
| start: | |
| ;; FIRST test: black border configured into default transparency fallback colour, inkmask 7 | |
| ; black border | |
| xor a | |
| out (254),a | |
| ; configure the NextULA palette (inkmask 7, select ULA palette for write, display first pals, enable NextULA mode) | |
| nextreg $42,$07 ,, $43,%0'000'0'0'0'1 |
This file contains hidden or 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
| ; (C) [copyleft] 2018 Peter Helcmanovsky | |
| ; License: CC0 https://creativecommons.org/share-your-work/public-domain/cc0 | |
| ; | |
| ; x86_64 linux asm example of fixed-point arithmetic | |
| ; (see https://en.wikipedia.org/wiki/Fixed-point_arithmetic) | |
| ; | |
| ; to build I'm using nasm and ld: | |
| ; nasm -f elf64 %f -l %n.lst -w+all; ld -b elf64-x86-64 -o %n %n.o | |
| ; (where %f is source file name and %n is just the main part w/o extension) | |
| ; |
NewerOlder