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
|
|||
![]() |
|
bitdog2u 04 Jun 2025, 15:38
Picnic has the right DOS code. For video mode 3 & maybe Vmode 1 also?
if it doesn't work, it's not the code that needs changing. At the garbage dump pick up an old DOS computer. Second hand stores ? I run DOS 6.2 on a 3.2 ghz North Wood CPU the fastest 100% DOS cpu made, that was common and reliable. Great with Redneck Rampage Rides Again running Uranus Attacks group. Straight DOS is a great environment for creating any .ASM to run on any OS. Then a JUMP DRIVE gets it to a computer running on an OS on CD so the HARD DRIVE won't be corrupted and you can test it. Well that is one way to do it. Altering the code to work in a bad environment, means that the only people who can use your code have to be using the same bad environment. = useless. You can print a whole colored screen with this proc. MSG: DW 160*10 ;Line 10 Vmode 3 DB 12,"Hello World",0 align 2 PRNstr: ;CALL with, DS:SI = message adr & ES = $B800 screen SEG LODSW MOV DI,AX ; Screen address LODSB MOV AH,AL ; Color LODSB @@: STOSW LODSB CMP AL,10 JZ PRNstr ; LF= Get another Line & put it some where CMP AL,0 JNZ @B ; Print Lines until NUL=0 RET |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.