tasm

Print numbers diagonally in assembly

梦想与她 提交于 2019-11-29 18:40:15
I'm trying to display 0-9 diagonally in assembly, but the output puts my diagonally printed numbers in the middle of the window. Here is the code: start: mov ah, 02h mov cl, 0Ah ;counter (10) mov dx, 02h ;mov bx, 02h mov dl, 30h ;start printing 0-9 mov dh, 02h ;start row mov al, 02h int 21h again: int 10h int 21h ;add dx, 01h inc dh inc dx inc al loop again mov ax, 4c00h int 21h The output should be: 0 1 2 3 4 5 6 7 8 9 The current output prints that, but on the middle of the window. I've tried adding a new register bh and use it to put my cursor on my current position when I execute the file.

Detect/receive multiple key-presses at the same time in DOS?

可紊 提交于 2019-11-28 14:43:11
I'm in the middle of writing air hockey in tasm and I have encounter a problem which is how I get two keys/clicks at once because I need to get both click at once to move both players in one time and Im trying a lot but I don't think I have a way to doing it. I heard that I need to read from the buffer directory and see what keys are there and read each one individually but I don't really know how to do this. Do you mind working with scancodes? I know this is not the simple, drop-in, solution you were looking for but I'm afraid there is none. So I'm writing this in the hope that, if not you,

Assembler can't locate existing files

三世轮回 提交于 2019-11-28 14:11:56
My TASM is mounted to the folder where my my TASM, TLINK, and files are. Specifically it is at C:/TASM/BIN . I have no problems when running a single .asm file but when I include an another file so that my code would look modular, there comes this problem. I have included 6 files as of now which includes printMzpos1.kt . (File extension doesn't matter in assembly file inclusion.) The name of my main file is c.asm . The image shows that printMzpos1.kt is in the folder where my TASM is mounted: Here is the snapshot of my code. I included printMzpos1.kt after main endp and before end main .

How to read image file and display on screen in windows tasm dosbox

末鹿安然 提交于 2019-11-28 13:14:57
Im currently learning graphical programming in tasm using dosbox. Ive been using a bunch of loops to draw square blocks of pixels and its really hard. I want to know if theres a way to read an image and display it. I know how to read a txt file maybe this is a start. Pls help You need to write/use image loader or use your own image file format. BMP may look simple but has too much in it like compression pixel formats etc but you still can focus on a specific type of BMP and ignore all the others... Back in the days of MS-DOS I was using 256 color PCX images with palette as I used 256 color

Print numbers diagonally in assembly

做~自己de王妃 提交于 2019-11-28 11:46:40
问题 I'm trying to display 0-9 diagonally in assembly, but the output puts my diagonally printed numbers in the middle of the window. Here is the code: start: mov ah, 02h mov cl, 0Ah ;counter (10) mov dx, 02h ;mov bx, 02h mov dl, 30h ;start printing 0-9 mov dh, 02h ;start row mov al, 02h int 21h again: int 10h int 21h ;add dx, 01h inc dh inc dx inc al loop again mov ax, 4c00h int 21h The output should be: 0 1 2 3 4 5 6 7 8 9 The current output prints that, but on the middle of the window. I've

How to generate a nasm compilable assembly code from c source code on Linux?

寵の児 提交于 2019-11-28 03:24:28
Test platform is 32 bit Linux. Basically, I know gcc can be used to generate both Intel and At&T style assembly code, but it seems that you can not directly use nasm/tasm to compile the Intel style assembly code gcc generated. I am conducting a project analysis asm code on both windows and Linux platform, so I am thinking if they can be both compiled by platform independent assembler like nasm\yasm, I could have a much easier time... So my question is how to generate a nasm compilable assembly code from c source code on Linux? Babken Vardanyan I find it's a better approach to disassemble the

tasm: operand type does not match

北战南征 提交于 2019-11-28 02:29:24
.model small .stack .data buff label byte maxchar dw 50 readchar dw 0 name1 db 48 dup(0) m1 db 10,13,"enter name: $" m2 db 10,13,"your name is: $" .code mov ax, @data mov ds, ax lea dx, m1 mov ah, 09 int 21h lea dx, buff mov ah, 10 int 21h mov ah,0 mov al, readchar add ax, 2 mov si, al mov buff[si],24H ;ascii code for $ to terminate string lea dx, m2 mov ah, 9 int 21h lea dx, name1 mov ah, 09 int 21h mov ah, 4ch int 21h end The operand type does not match error comes from trying to move a word sized variable into a byte sized register ( mov al, readchar ) a byte sized register into a word

Assembler can't locate existing files

喜欢而已 提交于 2019-11-27 19:33:07
问题 My TASM is mounted to the folder where my my TASM, TLINK, and files are. Specifically it is at C:/TASM/BIN . I have no problems when running a single .asm file but when I include an another file so that my code would look modular, there comes this problem. I have included 6 files as of now which includes printMzpos1.kt . (File extension doesn't matter in assembly file inclusion.) The name of my main file is c.asm . The image shows that printMzpos1.kt is in the folder where my TASM is mounted:

Assembly - bubble sort for sorting string

馋奶兔 提交于 2019-11-27 16:10:43
I am writing a program in assembly using tasm. My task is to write a program that will use bubble sort to sort entered string alphabetically. Ex. if you enter "hello" it should write "ehllo". I have writened the begging to enter string and to sort it (I think it works okey until the end where it should print out the result, but at the end it just writes my .data once and the finisheds its work) P.S sorry for bad english .model small .stack 100h .data request db 'This program is using bubblesort to get alphabetical order of your enterd string', 0Dh, 0Ah, 'Enter your string:', 0Dh, 0Ah, '$'

How to print colored string in assembly language?

大兔子大兔子 提交于 2019-11-27 09:39:37
Jan db " January$ " string db "Sun Mon Tue Wed Thu Fri Sat$" string1 db " 1 2 3$" string2 db " 4 5 6 7 8 9 10$" string3 db "11 12 13 14 15 16 17$" string4 db "18 19 20 21 22 23 24$" string5 db "25 26 27 28 29 30 31$" There are several ways to achieve your goal IN TEXT MODE : Display char by char : this way you can choose one color for every character. Access screen memory : at segment 0B800:0. Display the whole string with the same color. Next code does the job with the third option (the easiest). It was made with EMU8086: .stack 100h .data Jan db " January ",13,10 db "Sun Mon Tue Wed Thu Fri