x86-16

How to tell an 8086/8088 from an 80186?

被刻印的时光 ゝ 提交于 2020-05-27 06:21:46
问题 I am trying to write a program to check what processor is used to execute my program. Since this is intended to be used on a number of historic PC-clones, I want to be able to tell an 8086 from an 80186 just in case the computer is one of the rare machines that ship with an 80186. How can I do this in assembly? 来源: https://stackoverflow.com/questions/42306299/how-to-tell-an-8086-8088-from-an-80186

How to tell an 8086/8088 from an 80186?

纵饮孤独 提交于 2020-05-27 06:21:17
问题 I am trying to write a program to check what processor is used to execute my program. Since this is intended to be used on a number of historic PC-clones, I want to be able to tell an 8086 from an 80186 just in case the computer is one of the rare machines that ship with an 80186. How can I do this in assembly? 来源: https://stackoverflow.com/questions/42306299/how-to-tell-an-8086-8088-from-an-80186

Does modern PC video hardware support VGA text mode in HW, or does the BIOS emulate it (with System Management Mode)?

可紊 提交于 2020-05-25 04:31:27
问题 What really happens on modern PC hardware booted in 16-bit legacy BIOS MBR mode when you store a byte such as '1' (0x31) into the VGA text (mode 03) framebuffer at physical linear address B8000 ? How slow is a mov [es:di], eax store with the MTRR for that region set to UC? (Experimental testing on one Kaby Lake iGPU laptop indicates that clflushopt on WC was roughly the same speed as UC for VGA memory. But without clflushopt, mov stores to WC memory never leave the CPU and don't update the

What does ADD al, '0' do, and why use it before printing an integer digit?

耗尽温柔 提交于 2020-05-24 03:45:14
问题 I am a novice in assembly language programming I searched for binary search program and found this and I tried understand the program. It's working fine but I couldn't understand the success part of the code: what is ADD al,'0' and what is mov res,al ? .model small .stack 100h .data ARR DW 1000H,2000H,3000H,4000H,5000H,6000H LEN DW ($-ARR)/2 KEY EQU 2000H SUC DB "KEY IS FOUND AT$" FAILURE DB "KEY IS NOT FOUND$" RES DB "POSITION",13,10,"$" .CODE START: MOV AX,@data MOV DS,AX MOV BX,00 ;LOW MOV

What does ADD al, '0' do, and why use it before printing an integer digit?

∥☆過路亽.° 提交于 2020-05-24 03:45:07
问题 I am a novice in assembly language programming I searched for binary search program and found this and I tried understand the program. It's working fine but I couldn't understand the success part of the code: what is ADD al,'0' and what is mov res,al ? .model small .stack 100h .data ARR DW 1000H,2000H,3000H,4000H,5000H,6000H LEN DW ($-ARR)/2 KEY EQU 2000H SUC DB "KEY IS FOUND AT$" FAILURE DB "KEY IS NOT FOUND$" RES DB "POSITION",13,10,"$" .CODE START: MOV AX,@data MOV DS,AX MOV BX,00 ;LOW MOV

Don't understand what's wrong with my PCX code

风流意气都作罢 提交于 2020-05-16 06:33:18
问题 I have a code that shows a PCX using assembly By its width Example image 320x200 x=0, y=0 But if X ( StartPictX ) and Y ( StartPictY ) are unequal to 0, it ruins the picture. And I need to fix that... The original code: ;-------------------------------------- ; Load and show file *.PCX 320x200x256 ; ;-------------------------------------- IDEAL MODEL large P386 MACRO SHOWPCX StartX, StartY, fName mov ax, [StartX] mov [Point_X], ax mov ax, [StartY] mov [Point_Y], ax mov dx, offset fName call

Assembly x86 program. Counting numbers in an input

…衆ロ難τιáo~ 提交于 2020-05-09 17:13:32
问题 Hello I am just learning assembly so I don't really understand many things yet. I have to write a program where the user inputs some kind of line of various letters numbers etc. And the program should count how many numbers there are in the input and print the counter out. Here is my code: .model small .stack 100h .data buffer db 100, ?, 100 dup (0) count db 0 .code start: mov ax, @data mov ds, ax mov dx, offset buffer mov ah, 0Ah int 21h mov ah, buffer xor si, si xor cx, cx .loop: .notdigit:

How to make 20 bit address by using two 16 bit registers?

橙三吉。 提交于 2020-05-09 08:07:29
问题 IAPX88 can deal with 1 mega byte memory(20 bit addressing), now my question is how we make a 20 bit address by using two 16 bit registers.please give an example. 回答1: IAPX88 physical addresses are computed by taking the segment register, shifting it to the left 4 bits, and adding the offset register. For example, the physical address in memory that code executes is (CS<<4)+IP where CS is the Code Segment and IP is the Instruction Pointer. You can get details on the Intel 8086 wikipedia page.

Creating an x86 assembler program that converts an integer to a 16-bit binary string of 0's and 1's

核能气质少年 提交于 2020-05-09 06:57:46
问题 As the question suggests, I have to write a MASM program to convert an integer to binary. I have tried many different approaches, but none of them helped me at all. The final code I'm working on is as follows. I get an access memory violation error when I debug my code in Visual Studio . Any help on how to solve the error and if I'm on the right track or not will be greatly appreciated. The first code is my C++ code which passes a char array to an .asm file to be converted to binary. #include

80286: Which is the fastest way to multiply by 10?

浪子不回头ぞ 提交于 2020-05-09 06:31:07
问题 To multiply a number by any any multiple of 2, I'll shift it those many times. Is there any such technique to multiply a number by 10 in less cycles? 回答1: The 80286 did not have a barrel shifter, that was introduced with the 80386. According to the timing tables in the Microsoft Macro Assembler 5.0 documentation (1987), SHL reg, immed8 takes 5+n cycles, whereas SHL reg, 1 takes 2 cycles. ADD reg, reg takes 2 cycles, as does MOV reg, reg . IMUL reg16, immed takes 21 cycles. Therefore, the