如何28h从rsp以下计算中减去(十进制40)的值:
option casemap:none
includelib kernel32.lib
includelib user32.lib
externdef MessageBoxA : near
externdef ExitProcess : near
.data
text db 'Hello world!', 0
caption db 'Hello x86-64', 0
.code
main proc
sub rsp, 28h ; space for 4 arguments + 16byte aligned stack
xor r9d, r9d ; 4. argument: r9d = uType = 0
lea r8, [caption] ; 3. argument: r8 = caption
lea rdx, [text] ; 2. argument: edx = window text
xor rcx, rcx ; 1. …Run Code Online (Sandbox Code Playgroud) 我目前正在使用操作系统,我们的老师为我们的实验室分配了此问题,但他的帮助不是很大。因此,我需要显示带有信号量的死锁的基本示例,并且我的输出需要演示死锁的发生。我假设他的意思是如果发现我的例外情况。这和我已经接近了。
import java.util.concurrent.Semaphore;
public class deadlockTest2
{
private Semaphore sem1=new Semaphore(1);
private Semaphore sem2=new Semaphore(1);
private int num;
public deadlockTest2(int random)
{
num=random;
}
public void run()
{
try
{
sem1.acquire();
}
catch (InterruptedException e)
{
System.out.println("I am deadlocked");}
}
public static void main(String[] args)
{
deadlockTest2 tester=new deadlockTest2(5);
deadlockTest2 tester2=new deadlockTest2(20);
tester.run();
tester2.run();
}
}
Run Code Online (Sandbox Code Playgroud)
〜
〜
上午我还差得远?我一直在阅读材料,但没有完全掌握。我想我不明白什么是过程。有人请帮忙。
当我有滚动代码时怎么可能.当我希望它打印12时,有一种打印10的方法:
public class Opgave1d {
PrintStream out;
int p = 5;
int q = 10;
public Opgave1d() {
out = new PrintStream(System.out);
}
void methode1(int p) {
this.p = p + 2;
q = 4 * p;
out.printf("%d\n%d\n", p, q);
}
void start(){
methode1(q);
}
}
Run Code Online (Sandbox Code Playgroud)
怎么可能它打印10和40,40我得到它,但为什么它不打印:12 40 ???? 我感谢任何帮助!