Closing the Outer Loop in Visual Studio .NET

Drawing QR Code ISO/IEC18004 in Visual Studio .NET Closing the Outer Loop
Closing the Outer Loop
Reading Denso QR Bar Code In .NET
Using Barcode Control SDK for .NET framework Control to generate, create, read, scan barcode image in .NET applications.
But does that mean JCXZ closes the outer loop No JCXZ tells us when both loops are finished Closing the outer loop is done a little differently from closing the inner loop Take another look at the two nested loops: DoLine: mov BL,LineLen ; Each line will consist of 64 characters DoChar: stosw ; Note that there's no REP prefix! jcxz AllDone ; When the full set is printed, quit inc AL ; Bump the character value in AL up by 1 dec BL ; Decrement the line counter by one loopnz DoChar ; Go back & do another char until BL goes to 0 add DI,(ScrnWidth - LineLen)*2 ; Move DI to start of next line jmp DoLine ; Start display of the next line The inner loop is considered complete when we've displayed one full line of the ASCII table to the screen BL governs the length of a line, and when BL goes to zero (which the LOOPNZ instruction detects), a line is finished LOOPNZ then falls through to the ADD instruction that modifies DI We modify DI to jump from the end of a completed line to the start of the next line at the left margin This means we have to "wrap" by some number of characters from the end of the ASCII table line to the end of the visible screen The number of bytes this requires is given by the assembly-time expression (ScrnWidth-LineLen)*2 This is basically the difference between the length of one ASCII table line and width of the visible screen Multiplying by 2 is done because each character position is actually represented by both a character and an attribute byte in the video refresh buffer The result of the
QR Code Maker In .NET Framework
Using Barcode generator for .NET framework Control to generate, create QR image in Visual Studio .NET applications.
expression is the number of bytes we must move into the video refresh buffer to come to the start of the next line at the left screen margin But after that wrap is accomplished by modifying DI, the outer loop's work is done, and we close the loop This time, we do it unconditionally, by way of a simple JMP instruction The target of the JMP instruction is the DoLine label No ifs, no arguments At the top of the outer loop (represented by the DoLine label), we load the length of a line back into the now-empty BL register and drop back into the inner loop The inner loop starts firing characters at the screen again, and will continue to do so until JCXZ detects that CX has gone to 0 At that point, both the inner and outer loops are finished, and the full ASCII table has been displayed SHOWCHAR's work is done, and it terminates
Decode QR Code JIS X 0510 In .NET Framework
Using Barcode reader for .NET framework Control to read, scan read, scan image in VS .NET applications.
SHOWCHARASM Recap
Create Barcode In VS .NET
Using Barcode generator for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications.
Let's look back at what we've just been through SHOWCHARASM contains two nested loops The inner loop shoots characters at the screen via STOSW The outer loop shoots lines of characters at the screen, by repeating the inner loop some number of times (Here, four) The inner loop is governed by the value in the BL register, which is initially set up to take the length of a line of characters (Here, 64) The outer loop is not explicitly governed by the number of lines to be displayed That is, you don't load the number 4 into a register and decrement it Instead, the outer loop continues until the value in CX goes to 0, indicating that the whole job is done The inner and outer loops both modify the registers that STOSW works with The inner loop modifies AL after each character is fired at the screen This makes it possible to display a different character each time STOSW fires The outer loop modifies DI (the destination index register) each time a line of characters is complete This allows us to break the destination string up into four separate, noncontinuous lines
Barcode Scanner In .NET Framework
Using Barcode decoder for .NET Control to read, scan read, scan image in .NET applications.
QR Code ISO/IEC18004 Generation In C#
Using Barcode drawer for .NET Control to generate, create QR image in .NET framework applications.
Encode QR Code ISO/IEC18004 In VB.NET
Using Barcode generation for Visual Studio .NET Control to generate, create QR Code ISO/IEC18004 image in .NET framework applications.
Paint Bar Code In .NET Framework
Using Barcode generator for Visual Studio .NET Control to generate, create barcode image in VS .NET applications.
Monarch Encoder In .NET Framework
Using Barcode creator for VS .NET Control to generate, create Rationalized Codabar image in Visual Studio .NET applications.
Recognizing Data Matrix ECC200 In .NET
Using Barcode reader for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications.
Generate Code 128 Code Set B In Java
Using Barcode drawer for Java Control to generate, create Code 128 image in Java applications.
Paint USS Code 128 In Visual Basic .NET
Using Barcode creator for Visual Studio .NET Control to generate, create Code 128 image in .NET framework applications.
Barcode Creation In VB.NET
Using Barcode maker for VS .NET Control to generate, create barcode image in .NET framework applications.