tasm

Memory-Mapped Graphics Output

旧街凉风 提交于 2019-12-10 16:54:09
问题 I'm exploring into drawing pixels and lines, using Memory-Mapped Graphics. I'm using TASM in Textpad, in Windows. When I click run the whole screen turns blue and that's it, no pixels drawn. .model small .stack .data saveMode db ? xVal dw ? yVal dw ? .code main proc mov ax, @data mov ds, ax call SetVideoMode call SetScreenBackground call Draw_Some_Pixels call RestoreVideoMode mov ax, 4c00h int 21h main endp SetScreenBackground proc mov dx, 3c8h mov al, 0 out dx, al mov dx, 3c9h mov al, 0 out

How to pass/retrieve DOS command-line parameters in a 16-bit assembly program?

旧城冷巷雨未停 提交于 2019-12-09 06:27:26
问题 I am writing some little tools for MS-DOS. Now I'm writing a Shutdown.com , like for Windows XP and greater. I have already written the entire code, now I just need to pass the argument from DOS. I need to pass the parameters "-r" to reboot and "-s" to shutdown. How can I do it? I'm using TASM(Turbo Assembler 4.1) on Windows 98 to link and compile. I'm looking for a very simple way to do it, and if possible, still a .COM program. I'm looking exactly like the ARGV and ARGC from C language, but

Difference between lea and offset

你说的曾经没有我的故事 提交于 2019-12-08 15:17:02
问题 ar db "Defference $" What's the difference between mov dx,offset ar and lea dx,ar I think both are doing same work, but what is the difference between these two 回答1: In this use-case LEA and MOV do the same thing. LEA is more powerful than MOV if you want to calculate an address in a more complex way. Lets for example say you want to get the address of the n'th character in your array, and the n is stored in bx. With MOV you have to write the following two instructions: Mov dx, offset ar add

Change the background color of dosbox console when executing a tasm program

眉间皱痕 提交于 2019-12-07 11:03:57
问题 I am trying to display x in the center of the screen and then change the background color of the console to blue. I have the following code that accomplishes everything except for changing the background color: TITLE screen1.ASM .MODEL SMALL .STACK 0100h .DATA .CODE start: MOV AX,@DATA MOV DS,AX MOV AX,0600h MOV BH,07h MOV CX,0000h MOV DX,184Fh INT 10h MOV AH,02h MOV BH,00h MOV DH,0Ch MOV DL,28h INT 10h MOV AH,02h MOV DL,'x' INT 21h MOV AX,4C00h INT 21h END start The code clears the screen,

How do I print SVGA Info on the screen in tasm?

牧云@^-^@ 提交于 2019-12-05 18:29:49
I am complete beginner to assembly, and graphics, any help would be appreciated. I got the svga info, but when i print it, it won't print anything. If anyone can explain why that would be great. Here is the code. If there is anymore explanations needed for what I have done let me know .MODEL SMALL .STACK 64 .DATA getinfo: VbeSignature db 'VESA' ; VESA VbeVersion dw 0000h ; Version OemStringPtr dd ? ; Producer Capabilities db 4 dup (?); Reserved VideoModePtr dd ? ; Modes TotalMemory dw ? ; Blocks OemSoftwareRev dw ? OemVendorNamePtr dd ? OemProductNamePtr dd ? OemProductRevPtr dd ? _Reserved_

Change the background color of dosbox console when executing a tasm program

纵饮孤独 提交于 2019-12-05 15:36:46
I am trying to display x in the center of the screen and then change the background color of the console to blue. I have the following code that accomplishes everything except for changing the background color: TITLE screen1.ASM .MODEL SMALL .STACK 0100h .DATA .CODE start: MOV AX,@DATA MOV DS,AX MOV AX,0600h MOV BH,07h MOV CX,0000h MOV DX,184Fh INT 10h MOV AH,02h MOV BH,00h MOV DH,0Ch MOV DL,28h INT 10h MOV AH,02h MOV DL,'x' INT 21h MOV AX,4C00h INT 21h END start The code clears the screen, displays x at the center of the dosbox window and gives control back to DOS. I'm trying to find out what

8086 Assembly (TASM): Displaying an ASCII character value as HEX

北慕城南 提交于 2019-12-04 08:46:32
问题 ** Edited for clarification and "cleaner" code. I'm trying to accept a character from the keyboard (any character) and convert it's ASCII value to hex, then display it. I know how to convert from base 10 to hex, but just to make sure I'm not using incorrect terminology: If I enter "c" in as my ASCII value, it's decimal value is 63. 63 divided by 16 (hex is base 16) = 3.9375. Save the quotient of 3 for later. Remainder * base (.9375 * 16) = 15. 15 is Hex character "F". Quotient divided by base

how to fix the output for x86 turbo assembly language

别来无恙 提交于 2019-12-04 06:38:49
问题 DOSSEG .MODEL SMALL .STACK 100h .DATA UserName db "Name: $" CLRF db 10,13,"$" inputName db 24 dup ("$") CurYear db "Current Year: $" inputCurrentYear dw 8 dup ("$") BirYear db "Birth Year: $" inputBirthYear dw 8 dup ("$") outputName db "Hello, $" outputAge db "Your age is $" currentYearH1 db "$" currentYearH2 db "$" birthYearH1 db "$" birthYearH2 db "$" answer1 dw "$" answer2 dw "$" .code BEGIN: ;open bracket mov ax,@data mov ds,ax mov es,ax mov al,03h mov ah, 00h int 10h lea dx,CLRF mov ah

How to pass/retrieve DOS command-line parameters in a 16-bit assembly program?

不问归期 提交于 2019-12-03 08:07:13
I am writing some little tools for MS-DOS. Now I'm writing a Shutdown.com , like for Windows XP and greater. I have already written the entire code, now I just need to pass the argument from DOS. I need to pass the parameters "-r" to reboot and "-s" to shutdown. How can I do it? I'm using TASM(Turbo Assembler 4.1) on Windows 98 to link and compile. I'm looking for a very simple way to do it, and if possible, still a .COM program. I'm looking exactly like the ARGV and ARGC from C language, but for Assembly 16-bits... shutdown -r will reboot shutdown -s will shutdown Remember that I already know

8086 Assembly (TASM): Displaying an ASCII character value as HEX

情到浓时终转凉″ 提交于 2019-12-03 00:51:26
** Edited for clarification and "cleaner" code. I'm trying to accept a character from the keyboard (any character) and convert it's ASCII value to hex, then display it. I know how to convert from base 10 to hex, but just to make sure I'm not using incorrect terminology: If I enter "c" in as my ASCII value, it's decimal value is 63. 63 divided by 16 (hex is base 16) = 3.9375. Save the quotient of 3 for later. Remainder * base (.9375 * 16) = 15. 15 is Hex character "F". Quotient divided by base (3 / 16) = 0.1875. Quotient is zero, so this is the last step in conversion. Remainder * base (.1875 *