flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Rosnic 15 May 2025, 22:05
use16
msg db 'ABCD' mov ax,0xB800 mov es,ax mov si,msg mov al,byte [si] mov [es:di],al mov [es:di+1],0x07 |
|||
![]() |
|
macomics 16 May 2025, 06:57
Code: org 0x100 mov ax, 0xB800 mov es, ax mov di, 2 * (9 * 80 + 30) ; 0x67C ; Position on screen (row 10, column 30) mov si, string mov bx, colors ; pointer to the color attributes mov cx, 6 ; number of characters next_char: lodsb ; load byte from ds:si into al, increment si mov ah, [bx] ; load attribute byte into ah stosw ; store ax at es:di, increment di by 2 inc bx ; move to next attribute loop next_char ; repeat for all characters mov di, 2 * (10 * 80 + 25) mov bx, 2 * (11 * 80 + 10) mov si, colored_string another_loop: mov al, [si] mov ah, [si + 2] stosw lodsw mov [es:bx], ax add bx, 2 cmp byte [si], 0 jnz another_loop int 0x20 ; ret string db 'Rosnic' colors db 0x0C, 0x0A, 0x0E, 0x09, 0x0B, 0x0F ; red, green, yellow, blue, cyan, white colored_string db 'R', 0x0C, 'o', 0x0A, 's', 0x0E, 'n', 0x09, 'i', 0x0B, 'c', 0x0F, 0 Last edited by macomics on 24 May 2025, 20:13; edited 1 time in total |
|||
![]() |
|
Rosnic 24 May 2025, 20:09
I'm compiling in pure binary code and using the VirtualBox simulator but it doesn't seem to work.
|
|||
![]() |
|
macomics 24 May 2025, 20:26
I have it working on qemu.
|
||||||||||||||||||||||||||||
![]() |
|
Picnic 24 May 2025, 23:16
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.