389 Posted Topics
Re: 1) We don't do homework for you. 2) Your explanation isn't clear enough. Hint: [code] nCount = | A - B | - 1 # Exclusive indexes nCount = | A - B | + 1 # Inclusive indexes [/code] | |
Re: You could write a service application to detect additional IP addresses assigned to the local computer name. You could detect USB devices. Every USB device has a ManufacturerId and a ProductId. Turns out most types of devices are usually made by few companies. Have the service application have an internal … | |
Re: The float to ASCII, clip, then ASCII to float is one method. You're only truncating by one decimal place! Not I said clip not round. So one method is [CODE=C] f = floor(N * 10.0f) * 0.1f; [/CODE] | |
Re: This may make your issue more obvious... [CODE] Quotient : Remainder = Dividend / Divisor AL : AH = AX / (8-bit) AX : DX = DX:AX / (16-bit) EAX : EDX = EDX:EAX /(32-bit) [/CODE] You needed to specfy a data type snce you're using a memory reference [CODE] … | |
Re: Review how VIDEO BIOS Interrupt 10h is suppose to function! You indicate string doesn't contain attributes with AX,1300h BUT Never set BL to indicate attribute to use! ALSO DL=column DH=Row Now check all your prints! | |
Re: ???? addi $t0, $t0, 0 # increment address in $t0 N = N + 0 Did you cut'n'paste improperly? Is code missing? | |
Re: You aren't being very clear! If you are using a more recent computer but somehow using an old DOS interface and not in an emulator, then you can use 32-bit instructions in Real Mode. An operand size instruction 66h is inserted before an instruction to command the processor to do … | |
Re: You can download processor books but my favorite reference is the 32/64-bit 80x86 Assembly Language Architecture Book. Your mathematical operation and/or compares will set conditional flags. You then branch based upon those flags. For math there is a signed result and an unsigned result. That book pg. 292 [code] Signed … | |
Re: code? Are you trapping for a keyword mult? How about trapping for operators 3 * 4 12 1 + 2 3 etc. Or even * 3 4 12 | |
Re: Okay, I'm flipping this back at you. Note the comments and decide for yourself! By the way. Did you mean ((xvy)^z)*2 ((x OR y ) AND z ) * 2 then next time... ((x | y) & z) * 2 Or did you mean ((x OR Y ) XOR z … | |
Re: Use a register to increment. Use a register as memory reference that you increment. Use a register for value loaded from memory. Use a register for current max index. You need to try to do this yourself. Post your code then we'll make comments! | |
Re: This sounds more like an engineering task. There are websites like guru.com, etc. where you can post this kind of thing and find someone to build it for you! You will need to indicate whether you're trying to create a new wheel chair or retrofit an existing one! You will … | |
Re: Code, what code? If I understand your need you need edge triggering. Assuming high until pull down upon edge trigger. Here's some C code. You need to create an assembly language equivalent! [code=Asm] // global values byte sw = 0xff; byte swEdge = 0x0; [/code] [code=Asm] // Keyboard input loop … | |
Re: Why are you showing us the binary output. Please show the source code used to generate that binary output or atleast the list file that contains both binary and the source assembly! | |
Re: I'm VERY VERY rusty on a 68HC12 [code] ldy #16 ;Loop 16 times Loop: asld ; Carry <- A <- B <- 0 MSB in carry psha ? ; a = Sum adda a,0 ; a=a+0+carry ? ; Sum = a pula dey bne $Loop [/code] Or branch around if … | |
Re: What you're trying to do is not useful to an application so why are you tinkering around in there? Most programmers who work in assembly can go their entire lives without working with system instructions. Are you planning on designing your own operating system or modifying an existing one? For … | |
Re: A command line selector should be a table of ASCII commands with associated enumeration. When a string match is found, then use the enumeration with a jump table to call that command handler! | |
Re: I think you misunderstand the syscall function. It doesn't return a four byte integer. It returns a string! You also aren't setting $a1 to maximum number of characters to read - 1. The function returns the string with a NULL terminaton. $a0 = buffer $a1 = sizeof buffer - 1 … | |
Re: You should enter your five integers by looping and storing in an array, then summing the array. In your code you don't need the compare as the addition will set the zero flag if the result is zero! [code=Asm] add sum, eax ; add entered value to accumulator sum jo … | |
Re: There is absolutely no reason for someone to be messing around with the binary in this era of assemblers and compilers. But if you are overly curious, run your debug. Open the command prompt and type debug followed by the file pathname of your exe file. You can then type … | |
Re: Different ways to solve your problem, but first a near relative jump is +127....-128 You can use an inverse branch logic. [code] if ! NeedToJumpUP goto next jmp far above next: [/code] You can also call a function so the jump distance isn't so far! | |
Re: The ASR Arithmetic Shift Right instruction affects four flags. N (Negative) Bit set if sign bit (MSB) is set! Z (Zero) Bit set if result is zero. C (Carry) Bit Set with previous value in LSB. LSB gets clocked into carry. V (Negative) XOR (Carry). Bit is set if N:1 … | |
Re: Won't work the way you think! A float is 32-bit so only have about 4-5 digits of precision. That number is WAY TOO BIG! So it will definitely be put into exponential form provided the buffer is large enough! It also depends upon how long a buffer is acceptable! | |
Re: $LO = $s * $t [code] mult $t0,$t1 mfhi $t2 # HI mflo $t3 # LO la $a0, t0 equals li $v0, 4 #print_string syscall #t2 is HI #t3 is lOW # move $a0,$t0 move $a0,$t3 # Print lower 32-bits li $v0, 1 syscall [/code] | |
Re: The Auxiliary Carry (AF bit of Status Flags) is used for the carry out of bit 3 (0...7) into bit 4 for use in BCD operations! Think of it as a nibble carry! | |
Re: MIPS doesn't have a carry bit like the 80x86 so you have to emulate it! If result of lower 32-bit addition is less then any of the original values then a carry occured! So use the result of the compare to indicate a 0=no carry, 1=carry. Use that as the … | |
Re: You can also do it in BCD! No need for decimal to ASCII conversion! This is just one way to do this! [code=Asm] mov bh,'8' mov bl,'4' sub bh,'0' sub bl,'0' ;bh = 10's digit, bl=1's digit mov al,bl ; Handle 1's sub al,1 aas mov bl,al mov al,bh ; … | |
Re: Technically that's not a string reversal. If you were to push your characters into a buffer, then reverse them, that's a string reversal! But your code appears to be okay! Do you have a specific problem? | |
Re: LEAVE STI ALONE!!!!!!!!!!!!!! Interrupts are already turned on! If they weren't no input would be handled. No keyboard, no anything as they are all interrupt driven! There is a Serial BIOS in DOS. If you're using a simulator you're dependent upon what interrupts they actually implemented! Typicall DOS, keyboard, and … | |
Re: Technically ASCII used to be 7-bit ASCII but with International characters etc. it is 8-bit so treat it as unsigned bytes. signed and unsigned have different comparisons! Digits is the smallest subset 10 of 255 posibilities, so checking for a digit is the better solution. '0' 0x30 48 '9' 0x39 … | |
Re: [code=Asm] # Set Output buffer terminator (one character in length) # output[0] = character, output[1] = 0 terminator la $a0, output # output will be single character move $a1,$zero # Set our source buffer index to 0. sb $a1, 1($a0) # Set output buffer terminator for ASCIIZ output la $a0, … | |
Re: You will require a semaphore to keep both threads from accessing the same data simultaneously. Thread#1 [CODE] {BLOCK} Var += 4; {UNBLOCK} [/CODE] Thread#2 [CODE] {BLOCK} Var -= 4; {UNBLOCK} [/CODE] Otherwise you run the risk of both simultaneously accessing the same argument. There is only one processor that I'm … | |
Re: Post padding isn't the optimal solution. Pre-padding is! Do a 32 bit write each write no loop! [code] unsigned char vect2enc[4][32]; uint32 *pAry = (uint32 *) vect2enc; *(pAry+0) = 0; *(pAry+1) = 0; : *(pAry+31) = 0; [/code] Of course this would be much faster in assembly code. [code=Asm] mov … | |
Re: What week in school of how many weeks? Can you turn on graphics mode and paint pixels yet? If so, that opens the window for many possibilities! Years ago for my Final Assembly Language project, I chose a circle and line drawing algorithm using self modifying code and the Bresenham … | |
Re: So only working with lower case in the 'a' to 'z' range for now? Simple cypher exchange ;cmp [si],'$' cmp byte ptr [si],'$' Put the '$' check at the bottom of the loop to save an extra jump each loop! You can put a pre-jump at the top to jump … | |
Re: You're trying to buid a DOS application. Not a 32-bit or Extended DOS application. Keep SEG out of it. Technically your code segment is your data segment and your stack segment! | |
Re: Of course you need $a0 to be the address of the buffer An $a1 to be the maximum number of characters to read (buffer size - 1) as a terminator is written! Since the data is in $a0 you will need to do a load byte (LB) with 0 offset … | |
Re: I would create a table of accumulated days DaysTbl[] = { 0, 31, 59, etc. } Find your day count base in the table. That index is your 0 based month! The difference is the day count that month! You could also use a days in each month and a … | |
Re: [code=Asm] .data Prompt: .asciiz "\n Please insert a string: " Buffer: .space 60 Bye: .asciiz "\n **** Adios Amigo - Have a good day****" .globl main .text main: li $v0, 4 # system call code for Print String la $a0, Prompt # load address of prompt into $a0 syscall # … | |
Re: Use the natural register size of the computer cpu mode. On a 16-bit Real Mode the assembler (or compiler) has to add an extra machine operand to instruct the processor that it is going to do a 32-bit operation. If in 32-bit Protected Mode the same has to occur for … | |
Re: Unfortunately that's not a short code snippet. You'll need to post your code and mention the tool set you're using! | |
Re: INT 10h AH=2 Set Cursor Position DH=Row DL=Column BH=page 0...7 | |
Re: Something seems wrong with your C code. x = y while x >= y x = x - z If z < 0, one loop if z > 0, many many loops Despite your C code, Your assembly would be something similar to the following! If the entire C function … | |
Re: Due to pipelining modern day processors can't be calculating with a simple equation! Your teacher should already be familiar with this fact! | |
Re: For the character set move you could do it manually [code=Asm] mov cx, 0x1a0 / 2 CopyFnt: mov ax,es:[di] inc di mov ds:[si],ax inc si dec cx jne CopyFnt [/code] | |
Re: In my OpenGL code I use the following... [code=C] // _______________________________________________ // Perform operations to 'Projection' matrix stack glMatrixMode(GL_PROJECTION); glLoadIdentity(); // matrix = identity x Perspective // PI/4, 2/h, 0.1f, 1000.0f // mtxWorld = identity // D3DXMatrixPerspectieFovLH( &mtxProj, (Radians)PI/3, w/h, 1.0, 1000.0f ); gluPerspective( 60, // Field of View 60 … | |
Re: Are you using Macros in GNU? Typically the assembly code for an 80x86 would look like [code=Asm] $L1: cmp eax,ebx jne L1 [/code] | |
Re: Can't do that due to forum rules. Hint: Review the forum for other MIPS code that uses key input and prints it and build your program ontop of that! |
The End.