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
; Authors: Omega, Ped7g, Baze ; (C) 2021 ; license: https://opensource.org/licenses/MIT | |
; Z80 assembly, syntax for sjasmplus: https://github.com/z00m128/sjasmplus | |
; to assemble run: sjasmplus omega_fades.asm | |
OPT --syntax=abf | |
DEVICE ZXSPECTRUM48,31999 | |
ORG $8000 | |
;------------------------------------------------------------------------------ | |
; ULA attributes "fade out" effect, going through PAPER/INK values, | |
; decrements them (individually) by 1 every iteration (call of routine) |
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] 2021 Peter Helcmanovsky | |
; License: CC0 https://creativecommons.org/share-your-work/public-domain/cc0 | |
; | |
; x86_64 linux asm example of base64 encoding | |
; | |
; reads stdin, encodes it to base64 without new-lines, outputs to stdout | |
; | |
; the code is meant to be rather straightforward and simple (for lecturing purpose), | |
; not performance optimal | |
; |
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
DEFINE USE_DMA_TO_CLEAR_SCREEN ; comment out to get LDIR clear version | |
DEFINE USE_DOUBLE_BUFFERING ; comment out to see single-buffer redraw issues | |
DEVICE ZXSPECTRUMNEXT | |
BORDER MACRO color? | |
ld a,color? | |
out (254),a | |
ENDM |
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
;; original facebook post in "Z80 Assembly Programming On The ZX Spectrum" group: | |
; Here's a challenge for your creativity. | |
; Create a Z80 assembly function with the following properties: | |
; Input in A: values in the range [1,32] | |
; Output in A: 1 for 1-8, 2 for 9-16, 4 for 17-32 | |
; No loops or other conditional jumps. | |
; No usage of ROM code. | |
; No comparisons. | |
; The function will map how many bits an integer needs to how many bytes it needs in a typical C style struct. |
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
; ZX SPECTRUM code, sjasmplus syntax: https://github.com/z00m128/sjasmplus | |
; alternative code for Allan Turvey post: https://www.facebook.com/groups/z80asm/posts/1982356728824612/ | |
ORG $8000-8 | |
DEVICE ZXSPECTRUM48, $ - 1 | |
size_start: | |
dg ...#.### | |
dg ....#### | |
dg ...##### | |
dg ...##### | |
dg ..###### |
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
; Author: Ped7g ; (C) 2022 ; license: MIT / GPL / Public Domain (pick whichever fits best for you) | |
; assembled with: https://github.com/z00m128/sjasmplus/ | |
; based on https://github.com/MartinezTorres/z80_babel project, written as comparison | |
; | |
; Notes for myself about debugging/verification: in CSpect debugger `SAVE "data.bin",from,length` | |
; Then `hexdump -v -e '/2 "%u\n"' DATA.BIN > data.txt`. Then compare with `sort -g data.txt` | |
DEFINE ORG_ADR $8080 ; using only uncontended faster memory, but smaller buffers | |
OPT --syntax=abf : CSPECTMAP "qsort.map" |
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) | |
; |
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
; Author: Ped7g ; (C) 2022 ; license: MIT / GPL / Public Domain (pick whichever fits best for you) | |
; sort array of pointers to 64 char long strings (for example filenames) | |
; assembled with: https://github.com/z00m128/sjasmplus/ | |
DEFINE ORG_ADR $8080 ; using only uncontended faster memory, but smaller buffers | |
OPT --syntax=abf : CSPECTMAP "qsorts.map" | |
DEVICE ZXSPECTRUM48, ORG_ADR-1 | |
ORG ORG_ADR |
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
; ----- Colour palette (ULA) | |
BLACK equ 0 | |
BLUE equ 1 | |
RED equ 2 | |
MAGENTA equ 3 | |
GREEN equ 4 | |
CYAN equ 5 | |
YELLOW equ 6 | |
WHITE equ 7 |
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): copyright 2022 Peter Ped Helcmanovsky, license: MIT | |
; name: custom ZX Spectrum ROM to measure time until first /INT signal | |
; public gist somewhere at: https://gist.github.com/ped7g (search for it) | |
; | |
; to assemble (with z00m's sjasmplus https://github.com/z00m128/sjasmplus/ v1.20.1+) | |
; run: sjasmplus rom_first_int.asm | |
; | |
; history: 2022-08-23: v1.0 - initial version | |
; | |
; purpose: |
NewerOlder