assembly language step by step programming with dos and linux PHẦN 9

Như các ý kiến cho thấy, một thủ tục duy nhất có tên là VidChek lần đọc giá trị từ VidInfoTbl hai bảng tra cứu cấp và tải những giá trị vào các biến hiển thị ở trên. VidCheck là một sinh vật thú vị, và chứng minh cách đối phó với các bảng cấp hai. Đọc nó lên: | Recap Let s look back at what we ve just been through. 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 4 . 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. Both the inner and outer loops 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 non continuous lines. The Other String Instructions STOSW is only one of the several string instructions in the 86-family instruction set. I would have liked to cover the others here but space won t allow in this edition at least. In particular the MOVSW instruction Move String by Word is useful because it allows you to copy entire regions of memory from one place to another screamingly fast and with only a single instruction REP MOVSW You probably understand enough about string instruction etiquette now to pick up MOVSW yourself from an assembly-language reference. All of the same register conventions apply only with MOVSW you re working with both the source and destination strings at the same time. I felt it important to discuss not only the string instructions but their supporting cast of characters LOOP LOOPNZ and JCXZ. Individual instructions are important but not nearly as important as the full context within

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.