masm32

Can't output coprocessor float from variable two times in a row

谁说胖子不能爱 提交于 2021-01-29 14:35:55
问题 Good afternoon! In this example, I simply add two numbers with a comma, save the variable in tbyte and display the same variable two times in a row on the screen, but the first time I get 11.1 , as it should be, and the second time 4.667261E-062 . Why is this happening? And one more question, is it possible in tbyte to somehow save and access numbers by array type? for example, storing numbers in dd , I just could save and read them in increments of 4, for example, result [0] , result [4] ,

x86 MASM Assembly - Input Buffer holds old input despite FlushConsoleInputBuffer

余生长醉 提交于 2021-01-28 09:18:04
问题 To practice assembly in MASM, I created a small program that is supposed to do the do the following: Print "Type a: " to the screen Read one character from the input buffer, which is then flushed If the character is "a", then break away from the loop and end the program, if otherwise, repeat from step one My code goes as follows: .386 .model flat,stdcall include \masm32\include\kernel32.inc ; Defines Symbols To Be Used for the kernel32 library includelib \masm32\lib\kernel32.lib STD_OUTPUT

x86 assembly extreme novice inquiry: “invalid instruction operands”?

岁酱吖の 提交于 2020-11-29 10:09:03
问题 The code below is only a small fraction of the program I am currently attempting to write, but no other parts of the program are relevant, so I only pasted what was necessary. Anyway, what I am trying to do is move the value stored within inputLoopCounter into ecx in order to determine how many times a loop should execute. However, when I attempt to assemble this program, I get the error mentioned in the question title. Can anybody explain the reason for this? .data inputLoopCounter BYTE -1

x86 assembly extreme novice inquiry: “invalid instruction operands”?

…衆ロ難τιáo~ 提交于 2020-11-29 10:08:44
问题 The code below is only a small fraction of the program I am currently attempting to write, but no other parts of the program are relevant, so I only pasted what was necessary. Anyway, what I am trying to do is move the value stored within inputLoopCounter into ecx in order to determine how many times a loop should execute. However, when I attempt to assemble this program, I get the error mentioned in the question title. Can anybody explain the reason for this? .data inputLoopCounter BYTE -1

Confusing brackets in MASM32

北慕城南 提交于 2020-03-23 08:18:12
问题 I am trying to get to grips with MASM32 and am confused by the following: I thought that brackets were used for indirection so if I have the a pre-defined variable .data item dd 42 then mov ebx, item would put the contents of 'item', i.e. the number 42, into ebx and mov ebx, [item] would put the address of 'item', i.e. where the 42 is stored, into ebx. But the following code in a console app: mov ebx, item invoke dwtoa, ebx, ADDR valuestr invoke StdOut, ADDR valuestr mov ebx, [item] invoke

How do I write letter-initiated hexadecimal numbers in masm code?

点点圈 提交于 2020-02-16 10:30:08
问题 I am currently editing several macros consisting of MASM code. They all look similar to this: Primary MACRO Key 0Bh,'0' Key 29h,15h Key 03h,'2' Key 06h,'5' Key 0Ch,'+' Key 0Dh,'´' Key 1Bh,'¨' Key 2Bh,27h Key 35h,'-' Key 34h,'.' Key 33h,',' Key 56h,'<' ENDM I have noticed that I can write hexadecimal numbers which are initiated by (begin with) character 0-9 in the following format: 02h , 12h , 5Ah , etc. However, if I try to write letter-initiated hexadecimal numbers in the same way (that is,

Displaying Graphics in BIOS

99封情书 提交于 2020-01-16 18:57:08
问题 Using MASM32 is it possible to display bitmaps stored in a binary file embedded with the executable to the console? Can anyone show me how? Addendum: I'm not talking about a full fledge GUI here. Just the ability to display character bitmaps on the screen. They would be stored as 8x8 binary images in a file that we link to the executable. 回答1: You can do anything using MASM you could do with C or C++. However, using MASM doesn't give you any special abilities (you will still need to access

Displaying Graphics in BIOS

和自甴很熟 提交于 2020-01-16 18:56:20
问题 Using MASM32 is it possible to display bitmaps stored in a binary file embedded with the executable to the console? Can anyone show me how? Addendum: I'm not talking about a full fledge GUI here. Just the ability to display character bitmaps on the screen. They would be stored as 8x8 binary images in a file that we link to the executable. 回答1: You can do anything using MASM you could do with C or C++. However, using MASM doesn't give you any special abilities (you will still need to access

Float data example using Masm

三世轮回 提交于 2020-01-15 03:28:11
问题 Can somebody give me an example how to define a float number or constant in data section of MASM? Or at least some information about it... 回答1: I think it's done with .data myVar REAL4 1.0f .code Floating point values are REAL4, REAL8 or REAL10 in Masm. Expressions (such as #define myConst 1.0f) are done with myConst EQU 1.0 These are not specific to any section. 来源: https://stackoverflow.com/questions/13703907/float-data-example-using-masm

How does MASM .DATA? directive work internally [duplicate]

只愿长相守 提交于 2020-01-13 16:56:12
问题 This question already has an answer here : How to see the memory occupied by initialised array vs uninitialised array (1 answer) Closed 2 years ago . In Kip Irvines book I came across the following : The .DATA? directive declares uninitialized data. When defining a large block of uninitialized data, the .DATA? directive reduces the size of a compiled program. For example, the followingcode is declared efficiently: .data? bigArray DWORD 5000 DUP(?) ; 20,000 bytes, not initialized The following