dosbox

汇编语言学习笔记——————第一个程序

喜欢而已 提交于 2019-12-18 04:17:15
一个汇编语言从写出到最终执行的简要过程 大体分为以下三步: 1.编写汇编源程序 2.对源程序进行编译连接 3.执行可执行文件中的程序 第二步执行的操作是使用汇编语言编译程序对源程序文件中的源程序进行编译,产生目标文件;再用链接程序对目标文件进行连接,生成可在操作系统中直接运行的可执行文件。 第三步中,操作系统依照可执行文件中的描述信息,将可执行文件中的机器码和数据加载到内存,设置CS:IP指向第一条要执行的指令,然后由CPU执行程序。 下图是从汇编程序从写出到执行的详细步骤。 编写 1.asm 编译MASM 1.obj 连接LINK 1.exe 加载command 内存中的程序 运行CPU 编译链接 编译 为了使得我们编写的汇编语言程序得以执行,我们必须有相应的编译器和链接器,这里我们需要下载对应的三个文件,分别是MASM.exe、LINK.exe,ML.exe三个文件,对应的百度云链接如下: 链接: https://pan.baidu.com/s/15k0PZSgvO9JrAmilZ5U4Kg . 提取码:aswr 将下载的文件统一的放到一个文件夹下,如下图所示: 将三个文件拷贝至文件夹下就可以编译链表了,编译链接操作这里采用win10命令行窗口的方法进行编译和链接。编译链接前的文件下只有三个刚拷贝进来的文件,一个.asm文件和debug.exe(下面解释)

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

DOS:基本汇编语言开发环境配置及其增强

本秂侑毒 提交于 2019-12-17 03:41:47
DOS:基本汇编语言调试环境配置及其增强 前言(可跳过) 具体需求 基本要求的实现 1.安装并配置DOSBox 2.MASM 2.0的安装 开发环境的增强 1.Windows 3.2的安装 2.MASM 6.11的安装 图形界面下的运行 在Windows 3.2中安装MASM 6.11 安装Turbo C 2.0 总结与反思(可跳过) 前言(可跳过) DOS,磁盘操作系统的缩写,一类古老的操作系统,如今的人们甚至可能都未曾听闻。但是,在三十年前,计算机上还没有普及图形界面的操作系统,人们依靠命令行来完成对文件的操作。 无数程序员们戴着眼镜,在茶色窗户的大楼内,坐在显像管显示器前,依靠着简单的调试程序,打出一行行黑白的代码,这些代码共同构成了今天展现在我们眼前的五彩斑斓的图形界面的基础。 在那些缺乏便捷工具的日子里,人们依靠勤劳的双手,创造出了更加便捷的工具,这些工具更进一步帮助人们完成了更为复杂而高效的工具。通过这些更加高效的工具,程序员们最终打造出了如今精彩纷呈的计算机世界。 那是一段枯燥的日子,终日只有黑白字符相伴,但那也是一段精彩的日子,如今多彩的世界就是建立在那些日子的基础之上。 当如今我们用着极为便捷的编程工具时,是否有意识到,在那些缺乏高效工具的日子里,老一辈程序员是如何依靠简陋的工具以及命令行界面来打造出如今呈现在我们眼前的如此复杂而高效的集成开发环境的。那一代程序员

What is the best way to move an object on the screen?

北慕城南 提交于 2019-12-17 02:32:26
问题 I wanted to know what is the best way for moving an object on the screen- for expample: if some kind of shape presented on the screen(on graphic mode), I would like to move it left and right using the keyboard's arrows keys. I know how to read the keyboard buffer. The important thing is that I would like to know is how to move something smooth on the screen. I'm using DOS-Box, with 8086 architecture. And the movment must be on graphic mode (320X200). 回答1: OK finally got TASM+TLINK to work

Want to save value from a variable into register

妖精的绣舞 提交于 2019-12-14 04:14:17
问题 I m using MASM compilor and DOSBOX. I want to Want to save value from a variable into register. i want to save num1 value into cx register. How can i do that? .MODEL SMALL .STACK 50H .DATA num1 db '5' NL DB 0DH, 0AH, '$' msg db ?,0AH,0DH,"Enter an odd number between 0 to 10:$" nxtline db 0Ah,0DH,"$" .CODE MAIN PROC MOV AX, @DATA MOV DS, AX LEA DX,msg mov ah,9 int 21H LEA DX,nxtline mov ah,9 int 21H MOV AH,1 INT 21H LEA DX,nxtline mov ah,9 int 21H mov bl,al ;save the value from input mov num1

How can I compile code that uses graphics.h in DOSBOX?

妖精的绣舞 提交于 2019-12-13 02:26:41
问题 i write a code and in this code i use graphics.h ,in borland c++ or visual I can't open and run it, now i want run this code ,and i have DOSBOX 0.72 , how open this code with DOSBOX? my windows is 7 32bit 回答1: I see you're still trying to write and compile code that uses legacy and unsupported libraries... At least you've discovered now that you aren't going to be able to do this natively in Windows 7, and have installed a DOS emulator. Now, you'll need to find and download a compiler that

I'm trying to use the stored value in AX after the AAM instruction to divide it by 2, Why it doesn't work with 2 digits numbers output?

痴心易碎 提交于 2019-12-12 13:26:32
问题 English is not my native language; please excuse typing errors, the code I will show here is a homework. I really need to understand what's going on. I'm using Intel 8086 syntax, in DosBox 0.74 and TASM assembler. The problem with the code is in the Area of the Triangle when I have to divide by 2. Note: the program always read only 1 digit from the keyboard. Look at the code (a user here suggested to show all my code instead of show it by part, I think is a bit long, but I think he is right,

Creating a library in MASM while using dosbox

烈酒焚心 提交于 2019-12-12 01:45:20
问题 I have a question, i have been given an assignment to make a static library in assembly language i.e. MASM, but all the tutorials i find on the internet are either incomplete or too hard for me to understand. I am using dosbox since i have a 64 bit windows. Please help step by step Please and thank you 回答1: I suggest using DosBox only for running the final executable. You don't need DosBox to produce this executable, since Masm32 runs under 64 bit Windows. But the lib.exe shipped with Masm32

Programs hangs when opening COBOL Indexed file

半城伤御伤魂 提交于 2019-12-11 17:54:08
问题 I've recently started a COBOL course and, because of my computer configuration ( Windows 7 64 Bits and GNU/Linux 64Bits) I have to use Dosbox to compile and execute programs. Everything is going well but, I'n finding some troubles when I try to open an Indexed file , either I-O or Ouput mode. I can compile and link but at execution time, dosbox get frozen. My compiler version is MS-COBOL 5.0 and DosBox is 0.74 (last version). Does anybody have had this issue? Can someone tell how to fix it.

How to change bits in a char in TASM?

谁说我不能喝 提交于 2019-12-11 08:35:36
问题 I have to write a program which is reading chars from a file, changing bits in every char and writing changes to a new file in TASM. I've written a program which is reading chars from a file and writing them to a new file, but I don't know how to change bits in a char. For example, here would be my file with chars: a // 01100001 b // 01100010 c // 01100011 d // 01100100 So, if we are changing first and second bit to 1, the output should be: c // 01100011 c // 01100011 c // 01100011 g //