tasm

TASM 1.4 - Changing background color without clearing the screen?

久未见 提交于 2019-12-19 11:43:14
问题 I'm using Tasm 1.4. I'm trying to change the color of the background and text without clearing the previous text, but it always ends up on clearing the previous text although the colors are changed. For example: mov ah,09h lea dx,text1 int 21h ;displays text1 mov ah,01h int 21h ;I input a character mov ah,06h mov bh,42h mov cx,0000h mov dx,184fh int 10h ;I use this to change the text and background color mov ah,02h mov bh,00h mov dh,0ch mov dl,20h int 10h ;along with this mov ah,09h lea dx

TASM 1.4 - Changing background color without clearing the screen?

南楼画角 提交于 2019-12-19 11:43:09
问题 I'm using Tasm 1.4. I'm trying to change the color of the background and text without clearing the previous text, but it always ends up on clearing the previous text although the colors are changed. For example: mov ah,09h lea dx,text1 int 21h ;displays text1 mov ah,01h int 21h ;I input a character mov ah,06h mov bh,42h mov cx,0000h mov dx,184fh int 10h ;I use this to change the text and background color mov ah,02h mov bh,00h mov dh,0ch mov dl,20h int 10h ;along with this mov ah,09h lea dx

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

社会主义新天地 提交于 2019-12-17 20:42:53
问题 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 回答1: 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

TASM running LED animation with specific time of stop

和自甴很熟 提交于 2019-12-17 10:04:43
问题 Im very new in this assembly language can you guys help me .model small .stack .code org 100h start: main proc mov cx,1; how many times to loop here:mov al,00000001b mov dx,378h out dx,al call delay mov al,00000010b mov dx,378h out dx,al call delay mov al,00000100b mov dx,378h out dx,al call delay mov al,00001000b mov dx,378h out dx,al call delay mov al,00010000b mov dx,378h out dx,al call delay mov al,00100000b mov dx,378h out dx,al call delay mov al,01000000b mov dx,378h out dx,al call

Print triangle of numbers in assembly x86

北慕城南 提交于 2019-12-14 04:15:40
问题 I must do a program in tasm which have to print a triangle on numbers like this: input: n. Ex: n=4 output: 1 1 2 1 2 3 1 2 3 4 I've managed to make my program print this thing, but i also have to make it work with numbers between 0 and 255, not only for digits. I know that i have to read a number digit by digit and create a sum like this: if i have to read 82, i read firstly 8, put it in a register, and then, when i read 2, it must be added to 8*10. Can you help me to implement this in my

DIV instruction jumping to random location?

安稳与你 提交于 2019-12-13 15:17:45
问题 So I am having this exact problem. The solution given is to zero out DX , but in my case it already is! My program is to simply divide a 16 bit number by an 8 bit number. My code is: data segment num1 dw 0204h num2 db 02h quotient db ? remainder db ? data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax mov ax,num1 div num2 mov quotient,al mov remainder,ah mov ah,4ch int 21h code ends end start Any solution? 回答1: You badly need to start using whitespace to separate your

I don't understand why my program isn't working

坚强是说给别人听的谎言 提交于 2019-12-13 11:24:22
问题 I am trying to write a code that read and write text file with interrupt 21h. here is my code: IDEAL MODEL small STACK 100h DATASEG filename db 'testfile.txt',0 filehandle dw ? Message db 'Hello world!' ErrorMsg db 'Error', 10, 13,'$' CODESEG proc OpenFile ; Open file for reading and writing mov ah, 3Dh mov al, 2 mov dx, offset filename int 21h jc openerror mov [filehandle], ax ret openerror: mov dx, offset ErrorMsg mov ah, 9h int 21h ret endp OpenFile proc WriteToFile ; Write message to file

assembly reverse a string

本秂侑毒 提交于 2019-12-13 10:52:51
问题 The string is read until 1 is pressed, and the 1 will be on the last position of the string. I don't know why my output is off, for example the input is: asd1 and the output is: $1111. Anyway, here is my code data segment msg db 0dh,0ah,"Your string: $" rev db 0dh,0ah,"Reverted: $" s1 db 20 dup('$') s2 db 20 dup('$') data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax lea dx,msg mov ah,09h int 21h lea si,s1 lea di,s2 mov bx,0 l1: mov ah,01h int 21h mov [si],al inc bx

Assembly equation, Divide to get float value

∥☆過路亽.° 提交于 2019-12-13 09:23:12
问题 I have to do this equation in assembly (3*a-b/a)*(d+3) and i have with problem dividing b/a (10/20) the result should be 0.5 but I get 0. I really don't know how I could do it. My assignment is to fix the syntactical and logical errors in this given code: ;=============================================================================; ; ; ; File : arch1-2e.asm ; ; Format : EXE ; ; Assignment : Compilation, consolidation and debugging of assembly ; ; language programs ; ; Comments : The program

What does dw, db and ? (question mark) mean in TASM struc?

放肆的年华 提交于 2019-12-13 04:56:18
问题 I'm new to assembly, and now I'm trying to figure out what do the dw , db , and ? mean in a struc . For example here: struc segment_descriptor seg_length0_15 dw ? base_addr0_15 dw ? base_addr16_23 db ? flags db ? access db ? base_addr24_31 db ? ends segment_descriptor 回答1: "dw" is variable of type WORD, "db" is variable of type BYTE, dd is variable of type double word (int32_t). "?" means the values are not initialized. 来源: https://stackoverflow.com/questions/15934080/what-does-dw-db-and